//
//  TDNetwork.h
//  MovieDate
//
//  Created by ann on 16/3/18.
//  Copyright © 2016年 MovieDate. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface TDNetwork : NSObject

/*
 phone	必填	String	是用户的手机号，唯一确定用户。
 type	必填	String	"业务类型
 1：注册
 2：其它(如找回密码)"
 
 ret	"返回码
 1：成功
 -1:账户已经存在
 2、当type不等于1时，手机号不存在"
 code	验证码  注：临时返回 6位 已取消
 
 */

//发送短信验证码
+(void)sendDynCodePostURL:(NSString *)urlStr andPhoneNumber:(NSString *)number andType:(NSString *)type complete:(void(^)(BOOL succeed, NSString* ret, NSDictionary * dictionary))complete;


/*
 phone	必填	String	是用户的手机号，通过手机号唯一确定用户。
 code	必填	String	验证码，确定不是恶意用户。
 
 ret	"返回码
 2、手机号不正确（用户又去掉了手机号）
 -1、账号已经注册
 -2、验证码不正确
 -3、验证码超时 3分钟
 -4、手机号或者验证码（为空）不正确"
 res	验证后的随机数字random，需在注册的时候返回验证用户合法性
 */
//验证短信验证码
+(void)testDynCodePostURL:(NSString *)urlStr andPhoneNumber:(NSString *)number andCode:(NSString *)code complete:(void(^)(BOOL succeed,NSString * ret, NSDictionary * dictionary))complete;

/*
 phone	必填	String	是用户的手机号，通过手机号唯一确定用户。
 random	必填	String	"通过http://[xxx]/api/auth/regCode
 接口返回的随机数"
 pwd	必填	String	应用中用户设置的密码。密码有一定的规则
 type	必填	String	客户端类型 1:app 2:web
 headImage	必填	String	上传返回的头像ID（fid：如果不传头像，那么fid就默认为-1）
 nickName	必填	String	昵称
 userSex	必填	String	1、男  2、女  3、保密   性别
 userAge	必填	Integer	年龄
 movieLabel	必填	String	影签
 inviterPhone	选填	String	邀请人手机号
 mac	选填	String	设备号码
 imsi	选填	String	移动用户识别码
 systemName	选填	String	系统名称
 systemVersion	选填	String	系统版本
 
 ret	"返回码
 -2、随机数不对
 -3、超时 10分钟"
 token	客户端标示串 (注：web注册不返回此参数)
 
 */
//注册
+(void)registerPostURL:(NSString *)urlStr
        andPhoneNumber:(NSString *)number
             andRandom:(NSString *)token
             andPwd:(NSString *)passWord
             andType:(NSString *)type
              andHeadImage:(NSString *)headImage
             andNickName:(NSString *)nickName
              andUserSex:(NSString *)userSex
            andUserAge:(NSInteger)userAge
           andMovieLabel:(NSString *)movieLabel
          andInviterPhone:(NSString *)inviterPhone
          andMac:(NSString *)mac
           andImsi:(NSString *)imsi
         andSystemName:(NSString *)systemName
         andSystemVersion:(NSString *)systemVersion
  complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;


/*
 字段名称	是否必填	类型	描述
 phone	必填	String	是用户的手机号，通过手机号唯一确定用户。
 pwd	必填	String	应用中用户设置的密码。密码有一定的规则
 type	必填	String	客户端类型 1: Android 2:IOS 3:web
 mac		String	设备号码
 imsi		String	移动用户识别码
 systemName		String	系统名称
 systemVersion		String	系统版本
 deviceToken	必填	String	设备deviceToken
 deviceType	必填	String	设备类型1：安卓、2：IOS
 
 ret	"返回码
 1、登录成功
 -1、手机号或者密码不正确
 -2、账户已冻结
 -3、验证次数太多，稍后再试"
 token	登陆成功时返回,客户端标示串 (注：web注册不返回此参数)
 
 */
//登录
+(void)loginPostURL:(NSString *)urlStr
     andphoneNumber:(NSString *)phoneNumber
     andPwd:(NSString *)passWord
    andType:(NSString *)type
   andMac:(NSString *)mac
   andImsi:(NSString *)imsi
      andSystemName:(NSString *)systemName
   andSystemVersion:(NSString *)systemVersion
 andDeviceToke:(NSString *)deviceToken
      andDeviceType:(NSString *)deviceType
 complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//验证码登录
+ (void)loginPostURLPhoneCode:(NSString *)urlStr
              andphoneNumber:(NSString *)phoneNumber
                      andCode:(NSString *)code
                     andType:(NSString *)type
                      andMac:(NSString *)mac
                     andImsi:(NSString *)imsi
               andSystemName:(NSString *)systemName
            andSystemVersion:(NSString *)systemVersion
               andDeviceToke:(NSString *)deviceToken
               andDeviceType:(NSString *)deviceType
                    complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

/*
 phone	必填	String	手机
 code	必填	String	验证码
 pwd	必填	String	需要设置的新密码

 
 ret	"返回码
 2、手机号不正确（用户又去掉了手机号）
 1、成功
 -1、账号已经注册
 -2、验证码不正确
 -3、验证码超时 3分钟
 -4、手机号或者验证码（为空）不正确"
 */

//找回、修改 密码

+(void)changePasswordPostURL:(NSString *)urlStr
     andphoneNumber:(NSString *)phoneNumber
    andCode:(NSString *)code
   andPwd:(NSString *)passWord
 complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

/*
 page	必填	Integer	查询第几页数据
 pageSize	必填	Integer	每一页需要显示的数据
 
 ret	"返回码
 1、请求成功"
 res	"返回数据列表
 属性：
 filmList
 {
 movieId: 影片编号
 moiveImage: 影片图片ID
 moiveTitle: 影片名称
 moiveScore: 影片分数
 moiveTime: 影片时间
 moiveType：影片类型
 appNum：影片的影约发布数（只包括还未应约的）
 }"
 
 */

//电影列表
+(void)requestMoviesPOST:(NSString *)urlStr
                 andPage:(NSInteger ) page
             andPageSize:(NSInteger )pageSize
 complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;



/*
 page	必填	Integer	查询第几页数据
 pageSize	必填	Integer	每一页需要显示的数据
 curCity	必填	String	当前位置，当前市。
 curJd	必填	double	当前精度
 curWd	必填	double	当前纬度
 sexType	必填	String	性别 1、男 2、女  3、不限
 sortType	必填	String	"排序类型
 time:时间排序。默认
 dist：距离排序"
 sortVal	必填	String	排序值  asc:正排序 desc：反排序
 reqTime	必填	String	请求的时间，第一次请求的时间
 movieId	必填	String	电影的id
 
 
 res	"返回数据列表
 属性：
 movieList
 {
 appId: 影约编号
 movieId: 影片ID
 title: 影约名称
 releaseAddress: 发布地点
 meetTime: 影约时间
 releaseTime：发布时间
 meetAddress：影约地点
 meetPersonNum: 影约人数
 dist：距离
 
 userInfo  //发布人信息
 {
 headImage: 头像信息
 userAge: 状态
 userSex:性别
 }
 }"
 */



//影片详情
+(void)requestMoviesListPOST:(NSString *)urlStr
                 andPage:(NSInteger ) page
             andPageSize:(NSInteger )pageSize
                  andCurCity:(NSString *)curCity
                    andCurJd:(NSString *)curJd
                    andCurWd:(NSString *)curWd
                  andSexType:(NSString *)sexType
                 andSortType:(NSString *)sortType
                  andSortVal:(NSString *)sortVal
                  andReqTime:(NSString *)reqTime
                  andMovieId:(NSString *)movieId
                complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;


/*
 AppId	必填	String	影约ID
 title	必填	String	影约标题
 meetTime	必填	Integer	见面时间
 meetAddress	必填	Integer	见面地点
 needVerified	选填	String	是否需要实名认证
 takePeople	选填	String	影约人带外挂
 phone	必填	String	影约人电话(默认自己的注册账号，但是有可能修改)
 plan	必填	String	影约计划
 releaseAddress	必填	String	发布地点，后台根据此进行地区的筛选
 jd	必填	String	经度
 wd	必填	String	纬度
 moivieId	选填	String	影片ID，关联的影片
 
 
 ret	"返回码
 请求成功
 已被限制发单
 此地区未开放
 权限问题，不是自己的影约"
 */

//编辑影约
+(void)requestEditMovieMeetPostURL:(NSString *)urlStr
                         andAppId:(NSString *)appId
                         andTitle:(NSString *)title
                      andmeetTime:(NSInteger)meetTime
                   andmeetAddress:(NSString *)meetAddress
                  andneedVerified:(NSString *)needVerified
                    andTakePeople:(NSString *)takePeople
                         andPhone:(NSString *)phone
                          andPlan:(NSString *)plan
                andReleaseAddress:(NSString *)releaseAddress
                            andJd:(NSString *)jd
                            andWd:(NSString *)wd
                       andMovieId:(NSString *)movieId
 complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;


/*
 title	必填	String	影约标题
 meetTime	必填	String	见面时间
 meetAddress	必填	String	见面地点
 needVerified	选填	Integer	是否需要实名,认证应约人是否需要实名认证 0：不需要 1：需要
 takePeople	选填	Integer	应约人带外挂 0：男 1：女 2：男女均可 3：否
 phone	必填	String	影约人电话(默认自己的注册账号，但是有可能修改)
 plan	必填	String	影约计划
 releaseAddress	必填	String	发布地点，后台根据此进行地区的筛选
 jd	必填	String	经度
 wd	必填	String	纬度
 payType	选填（备用）	String	1、我付、2、他付  3、AA制
 movieId	必填	String	影片ID，关联的影片
 
 
 ret	"返回码
 1、请求成功
 2、已被限制发单
 3、此地区未开放"
 */
//发布影约
+(void)requestReleaseMovieMeetPostURL:(NSString *)urlStr
                          andTitle:(NSString *)title
                    andMeetAddress:(NSString *)meetAddress
                   andNeedVerified:(NSInteger)needVerified
                     andTakePeople:(NSInteger)takePeople
                          andPhone:(NSString *)phone
                 andReleaseAddress:(NSString *)releaseAddress
                             andJd:(NSString *)jd
                             andWd:(NSString *)wd
                        andPayType:(NSString *)payType
                        andMovieId:(NSString *)movieId
                       andMeetTime:(NSString *)meetTime
                           andPlan:(NSString *)plan
 complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

/*
 ret	"返回码
 请求成功"
 res	"返回数据列表
 属性：
 content: 消息内容,
 headImage: "/upload/20160223/1456200013325.jpg",
 readTime: 阅读时间,
 status: 消息状态,
 time: 产生时间,
 uid: 消息接收人,
 toUid:消息发送人
 uuid: 主键"
 
 */

//消息
+ (void)requestMessageListGetUrl:(NSString *)urlStr
                         andPage:(NSInteger)page
                     andPageSize:(NSInteger)pageSize
                       msgStatus:(NSString *)msgStatus
                        complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;


//喜欢
+(void)requestLikePostUrl:(NSString *)urlStr
                      andToUid:(NSInteger)toUid
                     complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//喜欢列表
+(void)requestLikeListPostUrl:(NSString *)urlStr
                      andPage:(NSInteger)page
                  andPageSize:(NSInteger)pageSize
                    complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//获取用户信息
+(void)requsetUseMessagePostUrl:(NSString *)urlStr
  complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;


//上传用户图片
+(void)uploadingUserPicImagePostUrl:(NSString *)urlStr
                            imgName:(NSString *)imgName
                            imgData:(NSString *)imgData
                              title:(NSString *)title
                               type:(NSString *)type
                           complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//获取用户图片
+(void)getImageUserPicImageGetUrl:(NSString *)urlStr
                              fid:(NSInteger)fid
complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;


//--------------------------------------用户设置里面的--------------------------------------------
//设置用户头像 前台只需要上传fid 告诉那张图片是头像  主要由后台操作
+(void)settingUserHeadImagePostUrl:(NSString *)urlStr
                               fid:(NSInteger)fid
                          complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//设置用户相册图片 前台只需要上传fid 告诉那张图片是头像  主要由后台操作
+(void)settingUserAlbumImagePostUrl:(NSString *)urlStr
                            albumId:(NSInteger)albumId
                                uid:(NSInteger)uid
                         albumTitle:(NSString *)albumTitle
                       albumContent:(NSString *)albumContent
  complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//设置用户相册图片 前台只需要上传fid 告诉那张图片是头像  主要由后台操作
+(void)settingUserAlbumImagePostUrl:(NSString *)urlStr
                          albumJson:(NSString *)albumJson
                           complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//获取账户相册
+(void)getUserAlbumImagePostUrl:(NSString *)urlStr
                                uid:(NSInteger)uid
complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;



//删除账户相册
+(void)deleteUserAlbumImagePostUrl:(NSString *)urlStr
                           albumId:(NSInteger)albumId
                          complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//账户信息修改保存
+(void)upDataUserMessagePostUrl:(NSString *)urlStr
                            uid:(NSInteger)uid
                          token:(NSString *)token
                       nickName:(NSString *)nickName
                        userSex:(NSString *)userSex
                      signature:(NSString *)signature
                        userAge:(NSString *)userAge
                     movieLabel:(NSString *)movieLabel
                   oftenAddress:(NSString *)oftenAddress
                      loveMovie:(NSString *)loveMovie
                   professional:(NSString *)professional
                      userSkill:(NSString *)userSkill
complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//首页用户列表
+(void)requestFirstUserListPostUrl:(NSString *)urlStr
                              page:(NSInteger)page
                          pageSize:(NSInteger)pageSize
                             curJd:(double)curJd
                             curWd:(double)curWd
                           userSex:(NSString *)userSex
complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//获取用户信息
+(void)requsetUseMessagePostUrl:(NSString *)urlStr uid:(NSString *)uid complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;



//喜欢接口
+ (void)requestLikeInterface:(NSString *)urlStr toUid:(NSInteger)toUid complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//关注接口
+ (void)requestCollection:(NSString *)urlStr toUid:(NSInteger)toUid complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//关注列表接口
+ (void)requestCollectionList:(NSString *)urlStr page:(NSInteger)page pageSize:(NSInteger)pageSize complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//取消关注操作
+ (void)requestDeleteCollection:(NSString *)urlStr toUid:(NSString *)toUid complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//我的发布列表接口
+ (void)requestMyReleaseMovieList:(NSString *)urlStr page:(NSInteger)page pageSize:(NSInteger)pageSize complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//确认约会列表接口
+ (void)requestMyConfirmMovieList:(NSString *)urlStr page:(NSInteger)page pageSize:(NSInteger)pageSize appId:(NSString *)appId releaseTime:(NSString *)releaseTime complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//确认约会接口
+ (void)requestConfirm:(NSString *)urlStr appId:(NSString *)appId releaseTime:(NSString *)releaseTime acceptUid:(NSInteger)acceptUid complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//成功约会列表接口

+ (void)requestMySuccessMovieList:(NSString *)urlStr page:(NSInteger)page pageSize:(NSInteger)pageSize complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//等待约会列表接口
+ (void)requestMyConfirmMovieList:(NSString *)urlStr page:(NSInteger)page pageSize:(NSInteger)pageSize complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//取消我的影约
+(void)cancleAcceptMovieURl:(NSString *)url appId:(NSString *)appId releaseTime:(NSString *)releaseTime  complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//取消、删除已发布影约
+(void)setMovieStatusURl:(NSString *)url objId:(NSString *)objUid status:(NSString *)status complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//编辑已发布的影约
+(void)updateReleaseMovieDateURl:(NSString *)url
                           AppId:(NSString *)AppId
                           title:(NSString *)title
                        meetTime:(NSString *)meetTime
                     meetAddress:(NSString *)meetAddress
                    needVerified:(NSInteger)needVerified
                      takePeople:(NSString *)takePeople
                           phone:(NSString *)phone
                            plan:(NSString *)plan
                  releaseAddress:(NSString *)releaseAddress
                              jd:(NSString *)jd
                              wd:(NSString *)wd
                        moivieId:(NSString *)moivieId
                         payType:(NSString *)payType
                        complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;


//赞操作
+ (void)requestZambia:(NSString *)urlStr toUid:(NSString *)toUid complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//我要应约接口
+ (void)requestAccept:(NSString *)urlStr acceptTime:(NSString *)acceptTime acceptAddress:(NSString *)acceptAddress appId:(NSString *)appId releaseTime:(NSString *)releaseTime complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//验证
+ (void)requestActivate:(NSString *)token complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

#pragma mark 标签
//标签列表
+(void)requestMovieLabelList:(NSString *)urlStr page:(NSInteger )page pageSize:(NSInteger )pageSize type:(NSInteger)type complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;
//添加标签
+(void)insertLabel:(NSString *)urlStr name:(NSString *)name type:(NSInteger)type complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;
//修改标签
+(void)updateUserLabel:(NSString *)urlStr userLabels:(NSMutableArray *)userLabels complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//举报接口
+ (void)inform:(NSString *)urlStr associationObj:(NSString *)associationObj passiveObj:(NSString *)passiveObj appTime:(NSString *)appTime complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//加入黑名单
+ (void)requestAddBlackList:(NSString *)urlStr toUid:(NSString *)toUid complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//移除黑名单
+ (void)requestDeleteBlackList:(NSString *)urlStr toUid:(NSString *)toUid complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//黑名单列表
+ (void)requestGetBlackList:(NSString *)urlStr
                    andPage:(NSInteger)page
                andPageSize:(NSInteger)pageSize
                   complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//电影票列表
+ (void)requestGetPrizesListPage:(NSInteger)page
                     andPageSize:(NSInteger)pageSize
                          status:(NSString *)status
                        complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

//领取电影票
+ (void)requestReceivePrize:(NSString *)ticketid complete:(void(^)(BOOL succeed, NSString * ret, NSDictionary * dictionary))complete;

@end
